package cn.com.blueInfo.bpm.person.enums;

import cn.com.blueInfo.bpm.common.enums.BaseEnum;
import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 组织级别
 * @author suxch
 * @since 2025-08-28 22:06:38
 */
@Getter
@AllArgsConstructor
public enum OrganizeLevelType implements BaseEnum<Integer> {

    /** 组织级别-公司 */
    COMPANY(1, "公司"),
    /** 组织级别-部门 */
    DEPARTMENT(2, "部门"),
    /** 组织级别-小组 */
    TEAM(3, "小组");

    @EnumValue
    private final Integer code;

    @JsonValue
    private final String desc;

    public static OrganizeLevelType getByCode(Integer code) {
        return BaseEnum.getByCode(OrganizeLevelType.class, code);
    }

    @JsonCreator
    public static OrganizeLevelType getByName(String name) {
        return BaseEnum.getByName(name, OrganizeLevelType.class);
    }

}
